Region Allocation

Objects within regions can be created using the following analogous expressions.

Note that new, malloc, calloc, rnew, rmalloc and rcalloc are keywords.

Here, the first argument specifies a region handle. The Cyclone library has a global variable Core::heap_region which is a handle for the heap region. So, for example, rnew (heap_region) expr allocates memory in the heap region which is initialized with expr. Moreover, new expr can be replaced with rnew(heap_region) expr.

The only way to create an object in a stack region is declaring it as a local variable. Cyclone does not currently support salloc; use a lexical region instead.